Skip to content

Set reward-size on each trial#131

Open
micahwoodard wants to merge 11 commits into
mainfrom
feat-trial-based-reward-size
Open

Set reward-size on each trial#131
micahwoodard wants to merge 11 commits into
mainfrom
feat-trial-based-reward-size

Conversation

@micahwoodard

@micahwoodard micahwoodard commented Jul 8, 2026

Copy link
Copy Markdown
Collaborator

Move reward size form task logic level to trial level. Allows to give fraction of reward for auto reward. Closes #85

At bonsai level, default reward is set to 2ul at initialization and during session, reward size is updated in calculate reward block

@micahwoodard

micahwoodard commented Jul 8, 2026

Copy link
Copy Markdown
Collaborator Author

@arjunsridhar12345 breaking change here. Reward size changes from task_logic.reward_size.right_valve_volume to trial_outcome.trial.reward_size.right

@bruno-f-cruz bruno-f-cruz changed the title trial based reward size Set reward-size on each trial Jul 8, 2026
Comment thread src/aind_behavior_dynamic_foraging/task_logic/trial_models.py Outdated
Comment thread src/aind_behavior_dynamic_foraging/task_logic/trial_models.py Outdated
Comment thread src/Extensions/TaskEngine.bonsai
Comment thread src/Extensions/ValveUi.bonsai
@micahwoodard

Copy link
Copy Markdown
Collaborator Author

@bruno-f-cruz I moved the calculating reward size to quiescent period. Moving to iti required setting it at the beginning of the session as well so made more sense to me to move into quiescent

@micahwoodard micahwoodard requested a review from bruno-f-cruz July 8, 2026 22:00
@micahwoodard

micahwoodard commented Jul 8, 2026

Copy link
Copy Markdown
Collaborator Author

@bruno-f-cruz Task engine now includes pre trial select many which sets reward size for each trial

image

@bruno-f-cruz bruno-f-cruz left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The distinctUntilChanged being inside the SelectMany doesnt really do anything since the sequence only fires once. The solution is to move it to the subject subscriber, ensuring you add it after filtering by side so you dont get false positives at the operator's input.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

auto water reward fraction

2 participants